package com.example.java2e.Service.Impl;

import com.example.java2e.Dao.NoticeDao;
import com.example.java2e.Entity.Message;
import com.example.java2e.Entity.Notice;
import com.example.java2e.Entity.Tip_off;
import com.example.java2e.Service.NoticeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;

@Service
public class NoticeServiceImpl implements NoticeService {
    @Autowired
    private NoticeDao noticeDao;
    @Override
    public void insertNewNotice(Notice new_notice) {
        noticeDao.insertNewNotice(new_notice);
    }
    @Override
    public void deleteNotice(String title, String date) {
        noticeDao.deleteNotice(title, date);
    }
    @Override
    public List<Notice> selectAllNotice() {
        return noticeDao.selectAllNotice();
    }
    @Override
    public Notice selectNoticeByTitleAndDate(String title, String date) {
        return noticeDao.selectNoticeByTitleAndDate(title, date);
    }
    @Override
    public List<Notice> selectNoticeForUser(String id) {
        return noticeDao.selectNoticeForUser(id);
    }
    @Override
    public Notice selectNoticeByTitle(String title) {
        return noticeDao.selectNoticeByTitle(title);
    }
    @Override
    public List<Message> selectAllMessage() {return noticeDao.selectAllMessage();}
    @Override
    public Message selectMessageByIdReply(Long id_reply) {
        return noticeDao.selectMessageByIdReply(id_reply);
    }
    @Override
    public List<Message> selectMessageByIdSend(String id_send) {
        return noticeDao.selectMessageByIdSend(id_send);
    }
    @Override
    public Message selectMessageByTitleDateAndIdSend(String title, String date, String id_send) {
        return noticeDao.selectMessageByTitleDateAndIdSend(title, date, id_send);
    }
    @Override
    public void insertNewMessage(Message new_message) {
        noticeDao.insertNewMessage(new_message);
    }
    @Override
    public void modifyIdReply(Long id, Long id_reply) {
        noticeDao.modifyIdReply(id, id_reply);
    }
    @Override
    public Message selectMessageById(Long id) {
        return noticeDao.selectMessageById(id);
    }
    @Override
    public void insertNewTipOff(Tip_off tip_off) {
        noticeDao.insertNewTipOff(tip_off);
    }
    @Override
    public void deleteTipOffByDriverStuAndDate(String id_driver, String id_stu, String date) {
        noticeDao.deleteTipOffByDriverStuAndDate(id_driver, id_stu, date);
    }
    @Override
    public List<Tip_off> selectAllTipOff() {
        return noticeDao.selectAllTipOff();
    }
    @Override
    public void modifyTipOffCondition(String id_driver, String id_stu, String date, int new_condition) {
        noticeDao.modifyTipOffCondition(id_driver, id_stu, date, new_condition);
    }
    @Override
    public Tip_off selectTipOffByDriverStuAndDate(String id_driver, String id_stu, String date) {
        return noticeDao.selectTipOffByDriverStuAndDate(id_driver, id_stu, date);
    }
}
